import request from '@/utils/request'

// 封装员工列表接口
export const getEmployeeAPI = (params) => {
  return request.get('/sys/user', { params })
}

// 封装下载文件接口
export const ExportEmployeeAPI = () => {
  return request({
    url: '/sys/user/export',
    method: 'get',
    responseType: 'blob'
  })
}

// 封装导出接口
export const getTemplateAPI = () => {
  return request({
    url: '/sys/user/import/template',
    method: 'get',
    responseType: 'blob'
  })
}

// 封装上传接口
export const uploadExcelAPI = (data) => {
  return request.post('/sys/user/import', data)
}
// 封装删除接口
export const delEmployeesAPI = (id) => {
  return request.delete(`/sys/user/${id}`)
}

// 封装新增接口
export const updateEmployeeAPI = (data) => {
  return request.post('/sys/user', data)
}

// 获取-员工-基本信息
export const reviseEmployeeAPI = (id) => {
  return request.get(`/sys/user/${id}`)
}

// 封装编辑
export const reviseListEmployeeAPI = (data) => {
  return request.put(`/sys/user/${data.id}`, data)
}

